/*
 * @Description: 
 * @Author: ouyaping
 * @Date: 2025-10-08 12:22:05
 * @LastEditors: ouyaping
 * @LastEditTime: 2025-10-10 22:11:58
 */
import request from '@/axios';

export const getIotrulesList = (params) => {
    return request({
        url: '/blade-desk/iotrules/list',
        method: 'get',
        params
    })
}
export const getDeviceList = (params) => {
    return request({
        url: '/blade-desk/iotrules/deviceList',
        method: 'get',
        params
    })
}
export const getFunctionDropdown = () => {
    return request({
        url: '/blade-desk/iotrules/functionDropdown',
        method: 'get'
    })
}

export const getIotrulesAttributeDropdown = (id) => {
    return request({
        url: '/blade-desk/iotrules/attributeDropdown',
        method: 'get'
    })
}

export const add = (row) => {
    return request({
        url: '/blade-desk/iotrules/save',
        method: 'post',
        data: row
    })
}

export const update = (row) => {
    return request({
        url: '/blade-desk/iotrules/update',
        method: 'post',
        data: row
    })
}

export const remove = (ids) => {
    return request({
        url: '/blade-desk/iotrules/remove',
        method: 'post',
        params: {
            id: ids,
        }
    })
}

export const getIotrulesDetail = (id) => {
    return request({
        url: '/blade-desk/iotrules/detail',
        method: 'get',
        params: {
            id,
        }
    })
}

export const updateStatus = (row) => {
    return request({
        url: `/blade-desk/iotrules/updateStatus?id=${row.id}&status=${row.status}`,
        method: 'post'
    })
}

